package com.kuang.swagger.controller;


import com.kuang.swagger.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
public class HelloController {


    @GetMapping(value = "/hello")
    public String hello(){
        return "hello";
    }


    // 只要我们的接口中，返回值存在User, 这个实体类就会被扫描到Swagger中
    @PostMapping(value = "/user")
    public User user(){
        return new User();
    }

    @ApiOperation("hello控制类注释")
    @PostMapping(value = "/hello1")
    public String hello1(@ApiParam("用户名") String username){
        return "hello";
    }

}
